Viacoin Core 0.16 RPC changes
As mentioned in the Viacoin Core 0.16 article, several RPC changes and other command line options have been changed:
New rescanblockchain
RPC
A new RPC rescanblockchain
has been added to manually invoke a blockchain rescan. The RPC supports start and end-height arguments for the rescan, and can be used in a multiwallet environment to rescan the blockchain at runtime.
New savemempool
RPC
A new savemempool
RPC has been added which allows the current mempool to be saved to disk at any time to avoid it being lost due to crashes / power loss.
Safe mode disabled by default
Safe mode is now disabled by default and must be manually enabled (with -disablesafemode=0
) if you wish to use it. Safe mode is a feature that disables a subset of RPC calls - mostly related to the wallet and sending - automatically in case certain problem conditions with the network are detected. However, developers have come to regard these checks as not reliable enough to act on automatically. Even with safe mode disabled, they will still cause warnings in the warnings
field of the getneworkinfo
RPC and launch the -alertnotify
command.
Renamed script for creating JSON-RPC credentials
The share/rpcuser/rpcuser.py
script was renamed to share/rpcauth/rpcauth.py
. This script can be used to create rpcauth
credentials for a JSON-RPC user.
Validateaddress improvements
The validateaddress
RPC output has been extended with a few new fields, and support for segwit addresses (both P2SH and Bech32). Specifically: * A new field iswitness
is True for P2WPKH and P2WSH addresses (“bc1…” addresses), but not for P2SH-wrapped segwit addresses (see below). * The existing field isscript
will now also report True for P2WSH addresses. * A new field embedded
is present for all script addresses where the script is known and matches something that can be interpreted as a known address. This is particularly true for P2SH-P2WPKH and P2SH-P2WSH addresses. The value for embedded
includes much of the information validateaddress
would report if invoked directly on the embedded address. * For multisig scripts a new pubkeys
field was added that reports the full public keys involved in the script (if known). This is a replacement for the existing addresses
field (which reports the same information but encoded as P2PKH addresses), represented in a more useful and less confusing way. The addresses
field remains present for non-segwit addresses for backward compatibility. * For all single-key addresses with known key (even when wrapped in P2SH or P2WSH), the pubkey
field will be present. In particular, this means that invoking validateaddress
on the output of getnewaddress
will always report the pubkey
, even when the address type is P2SH-P2WPKH.
Low-level changes
- The deprecated RPC
getinfo
was removed. It is recommended that the more specific RPCs are used: getblockchaininfo
getnetworkinfo
getwalletinfo
getmininginfo
- The wallet RPC
getreceivedbyaddress
will return an error if called with an address not in the wallet. - The wallet RPC
addwitnessaddress
was deprecated and will be removed in version 0.17, set theaddress_type
argument ofgetnewaddress
, or option-addresstype=[bech32|p2sh-segwit]
instead. dumpwallet
now includes hex-encoded scripts from the wallet in the dumpfile, andimportwallet
now imports these scripts, but corresponding addresses may not be added correctly or a manual rescan may be required to find relevant transactions.- The RPC
getblockchaininfo
now includes anerrors
field. - A new
blockhash
parameter has been added to thegetrawtransaction
RPC which allows for a raw transaction to be fetched from a specific block if known, even without-txindex
enabled. - The
decoderawtransaction
andfundrawtransaction
RPCs now have optionaliswitness
parameters to override the heuristic witness checks if necessary. - The
walletpassphrase
timeout is now clamped to 2^30 seconds. - Using addresses with the
createmultisig
RPC is now deprecated, and will be removed in a later version. Public keys should be used instead. - Blockchain rescans now no longer lock the wallet for the entire rescan process, so other RPCs can now be used at the same time (although results of balances / transactions may be incorrect or incomplete until the rescan is complete).
- The
logging
RPC has now been made public rather than hidden. - An
initialblockdownload
boolean has been added to thegetblockchaininfo
RPC to indicate whether the node is currently in IBD or not. minrelaytxfee
is now included in the output ofgetmempoolinfo
Other changed command-line options
-debuglogfile=<file>
can be used to specify an alternative debug logging file.- viacoin-cli now has an
-stdinrpcpass
option to allow the RPC password to be read from standard input. - The
-usehd
option has been removed. - viacoin-cli now supports a new
-getinfo
flag which returns an output like that of the now-removedgetinfo
RPC.