Skip to content

Conversation

@tecnovert
Copy link

Backport the scantxoutset rpc command from Bitcoin v17
https://github.com/bitcoin/bitcoin/blob/v0.17.0/doc/release-notes.md
Included only as much of the Descriptors code as required for scantxoutset to function.

@tecnovert
Copy link
Author

Should I close this PR?
#2780 is a more complete merge with more thorough functional tests attached.

@Fuzzbawls
Copy link
Collaborator

Should I close this PR? #2780 is a more complete merge with more thorough functional tests attached.

if #2780 satisfies your use case requirements then yeah, I think having a more feature-complete and more thorough functional testing would be the better choice.

@tecnovert tecnovert closed this Nov 8, 2022
Fuzzbawls added a commit that referenced this pull request Nov 20, 2022
fe55859 Add functional test for scantxoutset (PeterL73)
4452207 Remove commented out code (PeterL73)
c5ba307 Backport scantxoutset and descriptors from BitCoin Core v0.17.2 (PeterL73)

Pull request description:

  ## Issue being fixed or feature implemented
  As I didn't like the idea of backporting partial functionality of an upstream feature I looked at how `scantxoutset` and descriptors where implemented in BitCoin Core. Thanks to @tecnovert in #2778 I was able to easily locate the introduction point of `scantxoutset` and descriptors into BitCoin Core. As there were only a few files involved I tried to backport the complete functionality from [BitCoin Core v0.17.2](https://github.com/bitcoin/bitcoin/tree/v0.17.2).

  ## What was done
  - added `script/descriptor.cpp` and `script/descriptor.h` from BitCoin Core
  - removed non PIVX compatible code from `script/descriptor.cpp`
    - changed `#include <util.h>` to `#include <util/system.h>`
    - removed wpkh, wsh support
  - added `scantxoutset` related code to `rpc/blockchain.cpp` and `rpc/client.cpp`
  - made some minor adjustments in backported code in `rpc/blockchain.cpp`
    - changed `HexStr` call used for outputting scriptPubKey
    - removed P2WPKH references from the help description
    - changed _xpub/xprv_ to _DRKV/DRKP_ as prefix for extended keys in the help description
  - added SigningProvider related code to `script/sign.cpp` and `script/sign.h`
  - added the functional test `rpc_scantxoutset.py` from BitCoin Core
    - changed the addresses and keys to fit PIVX requirements
    - changed the first of the "non HD unspent outputs" tests from 0.002 to 0.007, because PIVX does not have P2SH_SEGWIT or BECH32 addresses only LEGACY addresses are used in this test
    - dashpay@4127918

  ## How Has This Been Tested
  This was tested using pivx-cli and pivx-qt, by scanning for unspent transaction output with different descriptors and with the functional test.

  ## Breaking Changes

ACKs for top commit:
  tecnovert:
    tACK fe55859
  Liquid369:
    tACK fe55859
  Fuzzbawls:
    ACK fe55859

Tree-SHA512: a2b57706e98d8ea8794f7e85eedab3e55546e3e6ec813ed5a784bbbc4071a34dc3cce2861374cd74c5bf20097676163bb100be309121b595b89395d90a7588d8
@Fuzzbawls Fuzzbawls removed this from the 5.5.0 milestone Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants