Merge bitcoin/bitcoin#14707: [RPC] Include coinbase transactions in receivedby RPCs

1dcba996d3 Coinbase receivedby rpcs release notes (Andrew Toth)
b5696750a9 Test including coinbase transactions in receivedby wallet rpcs (Andrew Toth)
bce20c34d6 Include coinbase transactions in receivedby wallet rpcs (Andrew Toth)

Pull request description:

  The current `*receivedby*` RPCs filter out coinbase transactions. This doesn't seem correct since an output to your address in a coinbase transaction *is* receiving those coins.

  This PR corrects this behaviour. Also, a new option `include_immature_coinbase` is added (default=`false`) that includes immature coinbase transactions when set to true.

  However, since this is potentially a breaking change this PR introduces a hidden configuration option `-deprecatedrpc=exclude_coinbase`. This can be set to revert to previous behaviour. If no reports of broken workflow are received, then this option can be removed in a future release.

  Fixes https://github.com/bitcoin/bitcoin/issues/14654.

ACKs for top commit:
  jnewbery:
    reACK 1dcba996d3

Tree-SHA512: bfc43b81279fea5b6770a4620b196f6bc7c818d221b228623e9f535ec75a2406bc440e3df911608a3680f11ab64c5a4103917162114f5ff7c4ca8ab07bb9d3df
This commit is contained in:
MarcoFalke
2021-12-07 20:47:37 +01:00
4 changed files with 197 additions and 14 deletions

View File

@@ -0,0 +1,19 @@
Wallet `receivedby` RPCs now include coinbase transactions
-------------
Previously, the following wallet RPCs excluded coinbase transactions:
`getreceivedbyaddress`
`getreceivedbylabel`
`listreceivedbyaddress`
`listreceivedbylabel`
This release changes this behaviour and returns results accounting for received coins from coinbase outputs.
A new option, `include_immature_coinbase` (default=`false`), determines whether to account for immature coinbase transactions.
Immature coinbase transactions are coinbase transactions that have 100 or fewer confirmations, and are not spendable.
The previous behaviour can be restored using the configuration `-deprecatedrpc=exclude_coinbase`, but may be removed in a future release.