Commit graph

269 commits

Author SHA1 Message Date
Glenn Willen
4ba4e0716d When validation is waiting for parent chain daemon, "stall".
Currently, if -validatepegin is given, and block validation can't proceed
because the parent chain is not synced, we mark the block invalid and put
it in a queue to be "revalidated" later. Unfortunately, marking a block
invalid has downstream consequences, in particular causing descendant blocks
to be marked invalid, which are not currently fixed by the queue.

Instead, we'll use a different strategy: if the mainchain daemon isn't
sufficiently synced to validate a block, we will "stall" connecting that
block to the chain, and have ActivateBestChain simply keep the tip at the
previous block until we're ready.

We can still download and validate (partly) blocks past this point while
we're waiting. They will be connected once the parent chain daemon catches
up.
2021-09-07 15:47:25 +00:00
Steven Roose
a0bd8870d6
Merge #917: [0.18 backport] Backport #911: When decoding or signing a PSBT, check blinded values.
6d557b9a3 When decoding or signing a PSBT, check blinded values. (Glenn Willen)

Pull request description:

Tree-SHA512: 0604ae37e42d0f83487d3370c64ac3968cbb813580138a32280bb147bbe8378a4306a4f6fd194cc58024b5288a551627d17c162cc110a60032fa9c69c9d51c4b
2020-10-06 20:06:48 +02:00
Steven Roose
e77d754b88
Merge #915: [0.18 backport] Backport #904: Fix parsing of amount commitments from prevtxs in signrawtransactionw…
4e3161620 Fix parsing of amount commitments from prevtxs in signrawtransactionwithkey (Glenn Willen)

Pull request description:

Tree-SHA512: ead69e32fb14ee85f776f786f8510df1b71432e2f3fa02588913c94566219d7b951987162be205269a67acc8b1f1cca84e78278b4bb28fb129b9ca339cda1672
2020-10-06 20:03:47 +02:00
Glenn Willen
6d557b9a3c
When decoding or signing a PSBT, check blinded values.
When we decode or sign a PSBT given to us via RPC, first check that, if
it contains blinded output values, they verifiably match the unblinded
output values contained in the original transaction proposal. Otherwise fail.
2020-10-06 13:45:11 +02:00
Glenn Willen
4e31616206
Fix parsing of amount commitments from prevtxs in signrawtransactionwithkey 2020-10-06 13:44:37 +02:00
Glenn Willen
91ec3dd165
Make error messages distinct at each failure location. 2020-10-06 13:43:39 +02:00
Glenn Willen
f335ff8456
Fix logic issues with randomization of outputs in [re]issueasset_base; minor refactoring. 2020-10-06 13:43:37 +02:00
Steven Roose
21b3913a71
Make issuance fail for invalid addresses
Without his change, invalid addresses are converted into fee outputs.
2020-04-16 12:34:42 +01:00
Gregory Sanders
5b2c79e49a Fix compilation of raw transaction operations with peg-in inputs 2019-09-06 10:24:00 -04:00
Gregory Sanders
b7aaf4be9e Add fedpeg_program field in dynafed header 2019-09-06 10:24:00 -04:00
Gregory Sanders
4829b3a88c signrawtransaction* should use up to date fedpegscript for peg-in signing 2019-09-06 10:24:00 -04:00
Gregory Sanders
f08756b5d7 OP_TRUE outputs should be allowed to be segwit-ified by decodescript 2019-09-06 10:06:44 -04:00
Gregory Sanders
0cfe03bec4 Expose fedpeg fetching to consensus and mempool internals 2019-09-06 10:06:44 -04:00
Steven Roose
6776a40611
Merge remote-tracking branch 'bitcoin/0.18' into elements-0.18 2019-08-21 19:30:53 +01:00
Glenn Willen
7449be0ec0
Disable PSBT RPCs when not in g_con_elementsmode. 2019-08-19 17:20:47 +01:00
Glenn Willen
16beefa2d2
PSBT for Confidential Assets 2019-08-19 17:20:41 +01:00
Sjors Provoost
ee950ec465
[rpc] walletcreatefundedpsbt: use wallet default RBF 2019-08-17 12:52:50 +02:00
Anthony Towns
1dc357dabb signrawtransactionwithkey: report error when missing redeemScript/witnessScript param
Github-Pull: #16250
Rebased-From: 01174596e6
2019-07-05 14:45:04 +10:00
Gregory Sanders
a7742ca3a2 Merge remote-tracking branch 'bitcoin-gh/0.18' into 0.18.0-backports 2019-06-26 11:58:58 -04:00
MarcoFalke
0023c97890 rpc: bugfix: Properly use iswitness in converttopsbt
Also explain the param in all RPCs

Github-Pull: #15899
Rebased-From: fa499b5f02
2019-06-18 09:34:10 -04:00
MarcoFalke
bb36ac82ef rpc: Switch touched RPCs to IsValidNumArgs
Github-Pull: #15899
Rebased-From: fa5c5cd141
2019-06-18 09:32:17 -04:00
Chris Moore
d24d0ec056 Add example 2nd arg to signrawtransactionwithkey
The RPC examples for signrawtransactionwithkey are missing the 2nd parameter.

Github-Pull: #16210
Rebased-From: 71fd628ada
2019-06-17 13:06:19 -04:00
Steven Roose
a9f589b9ec
Add support for blinding pegin transactions
Both via blindrawtransaction and rawblindrawtransaction.
2019-06-13 16:58:50 +01:00
Gregory Sanders
d710cb5880 rawissueasset: don't make explicit 0-value which gets blinded later 2019-06-05 15:52:13 +02:00
Steven Roose
de81c0d97e
MERGE-FIX: Fix linter (mostly RPC help)
I also moved some RPC methods that were not at the end of the file with
the other ELEMENTS RPC methods. This makes the diff on my machine look
crazy. Let's hope GitHub has more intelligent diffs..
2019-05-27 17:40:16 +01:00
Steven Roose
473e1e9ca1
MERGE-FIX: Fix compatibility functional tests 2019-05-22 16:54:46 +01:00
Steven Roose
52f6f6905b
WIP: Fix compilation after merge 2019-05-20 16:22:05 +01:00
Steven Roose
f4889a5253
UPSTREAM MERGE BROKEN: Merge upstream commit '519b0bc5dc' into master 2019-05-17 16:17:09 +01:00
Steven Roose
dc900eb7d7
Merge branch 'master' into catchup 2019-05-14 16:49:18 +01:00
Steven Roose
c8525c9387
Fix bug in converttopsbt 2019-05-03 14:28:45 +01:00
Steven Roose
7f894ae00b
UPSTREAM MERGE BROKEN: Merge commit 'f617e05c38' into master 2019-05-01 19:18:18 +01:00
Gregory Sanders
39357ca506 Create burn argument for createrawtransaction 2019-04-02 20:14:20 -04:00
Steven Roose
e1cd00cc6c Change branding from bitcoin to elements 2019-03-22 10:12:04 +00:00
Gregory Sanders
f56de12cdd Remove all but one circular dep: coinselection <-> wallet 2019-03-20 10:10:43 -04:00
Steven Roose
49e808373e
[BROKEN] Add raw issuance RPCs 2019-03-20 12:05:54 +00:00
Steven Roose
a03239dd31
[BROKEN] Add raw tx RPCs for CA 2019-03-20 12:05:53 +00:00
Steven Roose
703db5b42f
[BROKEN] Adapt existing RPCs to CA 2019-03-20 12:05:48 +00:00
Gregory Sanders
aa375e66c1
Replace CScriptID and CKeyID in CTxDestination with dedicated type 2019-03-20 12:05:31 +00:00
Pieter Wuille
232ef630ec
Fix overflow bug in analyzepsbt fee: CAmount instead of int
Github-Pull: #15582
Rebased-From: c9963ae8b1
Tree-SHA512: ed1dcfafb7015de5405112938b04c4009bec3349a8d4e8aca641598ccab31a34c7f16b5045670909fd2e795fc40640a79658ef6b1771e9f21abd0ca759b239b5
2019-03-13 19:36:36 +01:00
fanquake
2edd0c40c3
rpc: return a number for estimated_feerate in analyzepsbt
Github-Pull: #15559
Rebased-From: 335931df4a
Tree-SHA512: ebe460e935e33fbbbe725db403654ee65c86a606401e8519e1180551e2ccd43661eb4ad20bf065f2c0c2a8026c3bb3bce796789f8d612e9e197ceb8d541a63a9
2019-03-13 12:20:05 +01:00
fanquake
20fd64fe10
doc: correct analysepsbt rpc doc
Github-Pull: #15559
Rebased-From: a4d0fd026b
Tree-SHA512: 43f985ccb1af22e416230b8f351396d1fa677ee4e60f6952962ed37e842f5746df8a58ae7c35d6a7518af4b5974ee753b17ec3578394122584ca10e9ed561268
2019-03-13 12:20:01 +01:00
MarcoFalke
9999879f56
refactor: Use RPCHelpMan::IsValidNumArgs in getrawtransaction 2019-02-25 23:47:36 -05:00
MarcoFalke
fa9ff8fe21
doc: Remove misleading hint in getrawtransaction 2019-02-25 23:45:48 -05:00
MarcoFalke
169dced9a4
Merge #15408: Remove unused TransactionError constants
fa9b60c842 Remove unused TransactionError constants (MarcoFalke)

Pull request description:

  Fixup to #14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.

  Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).

Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
2019-02-22 11:13:43 -05:00
Wladimir J. van der Laan
d5b929c813
Merge #13932: Additional utility RPCs for PSBT
540729ef4b Implement analyzepsbt RPC and tests (Andrew Chow)
77542cf2a5 Move PSBT UTXO fetching to a separate method (Andrew Chow)
cb40b3abd4 Figure out what is missing during signing (Andrew Chow)
08f749c914 Implement joinpsbts RPC and tests (Andrew Chow)
7344a7b998 Implement utxoupdatepsbt RPC and tests (Andrew Chow)

Pull request description:

  This PR adds 3 new utility RPCs for interacting with PSBTs.

  `utxoupdatepsbt` updates a PSBT with UTXO information from the node. It only works with witness UTXOs because full transactions (as would be needed for non-witness UTXOs) are not available unless txindex is enabled.

  `joinpsbts` joins the inputs from multiple distinct PSBTs into one PSBT. e.g. if PSBT 1 has inputs 1 and 2, and PSBT 2 has inputs 3 and 4, `joinpsbts` would create a new PSBT with inputs 1, 2, 3, and 4.

  `analyzepsbt` analyzes a PSBT and determines the current state of it and all of its inputs, and the next step that needs to be done.

Tree-SHA512: 3c1fa302201abca76a8901d0c2be7b4ccbce334d989533c215f8b3e50e22f2f018ce6209544b26789f58f5980a253c0655111e1e20d47d5656e0414c64891a5c
2019-02-16 20:45:03 +01:00
Andrew Chow
540729ef4b Implement analyzepsbt RPC and tests 2019-02-16 11:51:02 -05:00
Andrew Chow
08f749c914 Implement joinpsbts RPC and tests
Adds a joinpsbts RPC which combines multiple distinct PSBTs into
one PSBT.
2019-02-16 00:04:27 -05:00
Andrew Chow
7344a7b998 Implement utxoupdatepsbt RPC and tests 2019-02-16 00:04:27 -05:00
MeshCollider
8d0ec74801
Merge #14021: Import key origin data through descriptors in importmulti
cb3511b9d Add release notes for importing key origin info change (Andrew Chow)
4c75a69f3 Test importing descriptors with key origin information (Andrew Chow)
02d6586d7 Import KeyOriginData when importing descriptors (Andrew Chow)
3d235dff5 Implement a function to add KeyOriginInfo to a wallet (Andrew Chow)
eab63bc26 Store key origin info in key metadata (Andrew Chow)
345bff601 Remove hdmasterkeyid (Andrew Chow)
bac8c676a Add a method to CWallet to write just CKeyMetadata (Andrew Chow)
e7652d3f6 Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp} (Andrew Chow)
c45415f73 Refactor keymetadata writing to a separate method (Andrew Chow)

Pull request description:

  This PR allows for key origin data as defined by the descriptors document to be imported to the wallet when importing a descriptor using `importmulti`. This allows the `walletprocesspsbt` to include the BIP 32 derivation paths for keys that it is watching that are from a different HD wallet.

  In order to make this easier to use, a new field `hdmasterkeyfingerprint` has been added to `getaddressinfo`. Additionally I have removed `hdmasterkeyid` as was planned. I think that this API change is fine since it was going to be removed in 0.18 anyways. `CKeyMetadata` has also been extended to store key origin info to facilitate this.

Tree-SHA512: 9c7794f3c793da57e23c5abbdc3d58779ee9dea3d53168bb86c0643a4ad5a11a446264961e2f772f35eea645048cb60954ed58050002caee4e43cd9f51215097
2019-02-15 12:11:28 +13:00
Wladimir J. van der Laan
3facd9fdc4
Merge #14481: Add P2SH-P2WSH support to listunspent RPC
6ca836ab3a Add release note for listunspent P2WSH change (MeshCollider)
928beae007 Add test for P2SH-P2WSH in signrawtransactionwithkey and listunspent (MeshCollider)
314784a60f Make listunspent and signrawtransaction RPCs support witnessScript (MeshCollider)

Pull request description:

  This is a reworked version of #11708 after #12427 and the `signrawtransaction` split.

  For a P2WSH address, listunspent should return the witness script, and for a P2SH-P2WSH address, it should also return the inner witness script (because SignTransaction will automatically wrap it in P2SH if required).

  Includes a test which also tests the behaviour of #12427, and release note.

Tree-SHA512: a8e72cf16930312bf48ec47e44a68f8d7e26664043c1b4cc0983eb25aec4087e511188ff9a0f181cd7b8a0c068c60d7f1e7e3f226b79e8c48890039dcf57f7b7
2019-02-14 22:17:52 +01:00