Such outputs can still be watched, and signed for, but they aren't treated as valid payments.
That means they won't cause transactions to appear in listtransactions, their outputs to be
shown under listunspent, or affect balances.
Inside IsMine we care about the distinction between scriptPubKey execution
and P2SH redeemScript execution. The consensus code does not care about this
distinction, and thus SigVersion does not have a field for P2SH. As the IsMine
code will care, it uses a separate enum with more fields.
Only IsMine's internal code needs this, as part of a recursion into P2SH and P2WSH
scripts. The exposed functions always operate on actual scriptPubKeys and not on
redeemScripts or witness scripts.
Zcash: Rewrote this commit so that it instead adds an internal
SigVersion argument (which we didn't have because it was added to
support SegWit logic).
Co-authored-by: Jack Grigg <jack@z.cash>
Before this, if someone imported a scriptPubKey directly (in hex form) using
importaddress, outputs sending to it would be treated as change, as the
corresponding CTxDestination was not added to the address book.
Fix this by trying to detect scriptPubKeys that are in fact convertible to a
CTxDestination and add them anyway. Add a warning to the RPC help to warn
against importing raw non-standard scripts.
Wallet interface refactor
This refactors the logic introduced in #4144 to improve the separation between the node and wallet. The notifier thread now lives next in `src/validationinterface.cpp` directly next to the existing `CMainSignals` node-wallet interface.
Part of #3877.
Bitcoin 0.12 cleanup PRs 2
Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#6631
- bitcoin/bitcoin#6664
- Only the first commit (we already had the second through bitcoin/bitcoin#6825).
- bitcoin/bitcoin#6669
- bitcoin/bitcoin#6887
- Only the non-QT parts.
- bitcoin/bitcoin#6962
- bitcoin/bitcoin#6822
- Only first and third commits (we already had the second through an earlier PR).
- bitcoin/bitcoin#7136
- Excludes Travis CI changes, and fixes to documents we don't have anymore.
- bitcoin/bitcoin#7084
- bitcoin/bitcoin#7509
- bitcoin/bitcoin#7617
- bitcoin/bitcoin#7726
Part of #2074.
The "hashtx" message was previously triggered synchronously inside
ConnectBlock, while the "hashblock" message is triggered in ConnectTip
immediately after ConnectBlock returns. Thus ZMQ would see a "hashtx"
for every relevant transaction, followed by a "hashblock".
Now, "hashtx" is triggered asynchronously once the cs_main lock is
dropped, which does not occur until after ConnectTip returns. Thus ZMQ
will see a "hashblock" immediately after the block is connected, and
then a "hashtx" for relevant transactions at some point afterwards.
Sapling can't be activated in the genesis block without recomputing it,
and we already activate Sapling by default in block 1, which is fine for
this RPC test.
Previously we only required synchronization points where blocks were
sent between nodes; now we need them between action and query operations
on the same node, because wallet notification of mined blocks no longer
occurs in real-time.
ThreadNotifyWallets now collects all notification-related state at once,
and then executes wallet logic based on the collected state after
dropping any locks it is holding.
* Introduce new constant MIN_CHANGE and use it instead of the
hardcoded "CENT"
* Add test case for MIN_CHANGE
* Introduce new constant for -mintxfee default:
DEFAULT_TRANSACTION_MINFEE = 1000