Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getrawtransaction(verbose) and decoderawtransaction of a same transaction returns different txid #15872

Closed
ChefJ opened this issue Apr 23, 2019 · 3 comments · Fixed by #15899
Closed

Comments

@ChefJ
Copy link

ChefJ commented Apr 23, 2019

For transaction f4dedd64c9841d53bbda8beeda52235ec986f1400606812d9c033ac34105532c, the call of [getrawtransaction(verbose)] and [getrawtransaction(hex) + decoderawtransaction] has totally different result,including txid.

Step of reproducing the issue:

  • Use getrawtransaction(hex) + decoderawtransaction
curl --user yourAuth --data-binary '{"jsonrpc": "1.0","id":"curltest","method":"getrawtransaction", "params": ["f4dedd64c9841d53bbda8beeda52235ec986f1400606812d9c033ac34105532c"] }' -H 'content-type: text/plain;' http://yourEndPoint

Returns:

{
	"result": "0100000000010115a16270d3ee7ccc58a0757c1d8e1763790f223d4e4c3823948fb3dfdf9865180100000000ffffffff023f3256000000000017a9142915a7db6c6df171fd0436c7cec0042195dad01c8738ee4647000000001600140aad95e932ba045c2daf31a04c36683d39efe91002473044022002537539ac9586fdd8b5947fa0a47dc002ebe57502608433e103efe2740f93d4022023b1ade7bdf0f002a8fdc4ec6d534588d2132ab88850ac426ea413b4adb465260121031ef964af6923a2111e4916afcc87c73a8980322cc761dd3648714dfda99e72c400000000",
	"error": null,
	"id": null
}

Decode with decoderawtransaction:

curl --user yourAuth  --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtransaction", "params": ["0100000000010115a16270d3ee7ccc58a0757c1d8e1763790f223d4e4c3823948fb3dfdf9865180100000000ffffffff023f3256000000000017a9142915a7db6c6df171fd0436c7cec0042195dad01c8738ee4647000000001600140aad95e932ba045c2daf31a04c36683d39efe91002473044022002537539ac9586fdd8b5947fa0a47dc002ebe57502608433e103efe2740f93d4022023b1ade7bdf0f002a8fdc4ec6d534588d2132ab88850ac426ea413b4adb465260121031ef964af6923a2111e4916afcc87c73a8980322cc761dd3648714dfda99e72c400000000"] }' -H 'content-type: text/plain;' http://yourEndPoint

Returns:

{
	"result": {
		"txid": "0b637b18840d8fc978a657a3422df3c246c86e4c4046d90e63bf0f86b179b403",
		"hash": "0b637b18840d8fc978a657a3422df3c246c86e4c4046d90e63bf0f86b179b403",
		"version": 1,
		"size": 223,
		"vsize": 223,
		"locktime": 0,
		"vin": [

		],
		"vout": [
			{
				"value": 90023651848.04721921,
				"n": 0,
				"scriptPubKey": {
					"asm": "8 OP_GREATERTHAN OP_DROP OP_SWAP 8e1763790f223d4e4c3823948fb3dfdf9865180100000000ffffffff02 3256000000000017a9142915a7db6c6df171fd0436c7cec0042195dad01c8738ee4647000000001600140aad95e932ba045c2daf31a04c36683d39efe91002 3044022002537539ac9586fdd8b5947fa0a47dc002ebe57502608433e103efe2740f93d4022023b1ade7bdf0f002a8fdc4ec6d534588d2132ab88850ac426ea413b4adb4652601 031ef964af6923a2111e4916afcc87c73a8980322cc761dd3648714dfda99e72c4",
					"hex": "58a0757c1d8e1763790f223d4e4c3823948fb3dfdf9865180100000000ffffffff023f3256000000000017a9142915a7db6c6df171fd0436c7cec0042195dad01c8738ee4647000000001600140aad95e932ba045c2daf31a04c36683d39efe91002473044022002537539ac9586fdd8b5947fa0a47dc002ebe57502608433e103efe2740f93d4022023b1ade7bdf0f002a8fdc4ec6d534588d2132ab88850ac426ea413b4adb465260121031ef964af6923a2111e4916afcc87c73a8980322cc761dd3648714dfda99e72c4",
					"type": "nonstandard"
				}
			}
		]
	},
	"error": null,
	"id": null
}

None of the "txid" or "hash" equals the hash I gave it at first(f4dedd64c9841d53bbda8beeda52235ec986f1400606812d9c033ac34105532c) .

  • Use getrawtransaction(verbose):
curl --user yourAuth --data-binary '{"jsonrpc": "1.0","id":"curltest","method":"getrawtransaction", "params": ["f4dedd64c9841d53bbda8beeda52235ec986f1400606812d9c033ac34105532c",true] }' -H 'content-type: text/plain;' http://yourEndPoint

This returns :

{
	"result": {
		"txid": "f4dedd64c9841d53bbda8beeda52235ec986f1400606812d9c033ac34105532c",
		"hash": "0b637b18840d8fc978a657a3422df3c246c86e4c4046d90e63bf0f86b179b403",
		"version": 1,
		"size": 223,
		"vsize": 142,
		"locktime": 0,
		"vin": [
			{
				"txid": "186598dfdfb38f9423384c4e3d220f7963178e1d7c75a058cc7ceed37062a115",
				"vout": 1,
				"scriptSig": {
					"asm": "",
					"hex": ""
				},
				"txinwitness": [
					"3044022002537539ac9586fdd8b5947fa0a47dc002ebe57502608433e103efe2740f93d4022023b1ade7bdf0f002a8fdc4ec6d534588d2132ab88850ac426ea413b4adb4652601",
					"031ef964af6923a2111e4916afcc87c73a8980322cc761dd3648714dfda99e72c4"
				],
				"sequence": 4294967295
			}
		],
		"vout": [
			{
				"value": 0.05648959,
				"n": 0,
				"scriptPubKey": {
					"asm": "OP_HASH160 2915a7db6c6df171fd0436c7cec0042195dad01c OP_EQUAL",
					"hex": "a9142915a7db6c6df171fd0436c7cec0042195dad01c87",
					"reqSigs": 1,
					"type": "scripthash",
					"addresses": [
						"35SFa5Aev3bjP7gfvfY959GSdWUrSdzoJn"
					]
				}
			},
			{
				"value": 11.95830840,
				"n": 1,
				"scriptPubKey": {
					"asm": "0 0aad95e932ba045c2daf31a04c36683d39efe910",
					"hex": "00140aad95e932ba045c2daf31a04c36683d39efe910",
					"reqSigs": 1,
					"type": "witness_v0_keyhash",
					"addresses": [
						"bc1qp2ket6fjhgz9ctd0xxsycdng85u7l6gs2x4dgh"
					]
				}
			}
		],
		"hex": "0100000000010115a16270d3ee7ccc58a0757c1d8e1763790f223d4e4c3823948fb3dfdf9865180100000000ffffffff023f3256000000000017a9142915a7db6c6df171fd0436c7cec0042195dad01c8738ee4647000000001600140aad95e932ba045c2daf31a04c36683d39efe91002473044022002537539ac9586fdd8b5947fa0a47dc002ebe57502608433e103efe2740f93d4022023b1ade7bdf0f002a8fdc4ec6d534588d2132ab88850ac426ea413b4adb465260121031ef964af6923a2111e4916afcc87c73a8980322cc761dd3648714dfda99e72c400000000",
		"blockhash": "00000000000000000011ca3164ee629216de2e5dae09ffb099815319f6e35a71",
		"confirmations": 1459,
		"time": 1555100160,
		"blocktime": 1555100160
	},
	"error": null,
	"id": null
}

which has the right transaction Id(txid).

They were supposed to return the same transaction,at least returns the same txid. Which result is more correct?

My node info:

{
  "result": {
    "version": 170100,
    "subversion": "/Satoshi:0.17.1/",
    "protocolversion": 70015,
    "localservices": "000000000000040d",
    "localrelay": true,
    "timeoffset": 10,
    "networkactive": true,
    "connections": 8,
    "networks": [
      {
        "name": "ipv4",
        "limited": false,
        "reachable": true,
        "proxy": "",
        "proxy_randomize_credentials": false
      },
      {
        "name": "ipv6",
        "limited": false,
        "reachable": true,
        "proxy": "",
        "proxy_randomize_credentials": false
      },
      {
        "name": "onion",
        "limited": true,
        "reachable": false,
        "proxy": "",
        "proxy_randomize_credentials": false
      }
    ],
    "relayfee": 0.00001000,
    "incrementalfee": 0.00001000,
    "localaddresses": [
      
    ],
    "warnings": ""
  },
  "error": null,
  "id": "curltest"
}
@achow101
Copy link
Member

achow101 commented Apr 23, 2019

This is (unfortunately) expected behavior. getrawtransaction is correct, decoderawtransaction is incorrect.

This issue occurs because the transaction is a segwit transaction which can be mistaken for a 0 input transaction by decoderawtransaction which needs to decode 0 input transactions. The heuristic used to distinguish between 0 input and segwit transactions that decoderawtransaction uses is not foolproof and there are still some false positives, such as your transaction. getrawtransaction is not confused because it is fetching the details of a transaction that exists on the network and thus cannot be a 0 input transaction. decoderawtransaction gives the wrong txid because it is including the segwit data in the txid when it shouldn't.

decoderawtransaction has an optional parameter iswitness which is used to indicate whether it should consider the transaction to be a segwit transaction and decode it as such. You should get the correct result (the same as getrawtransaction) if you set that to true (i.e. bitcoin-cli decoderawtransaction <raw tx> true).

@ChefJ
Copy link
Author

ChefJ commented Apr 23, 2019

@achow101 Thanks for your explanation,my problem's solved.

@jnewbery
Copy link
Contributor

This would make a useful stack exchange Question/Answer!

meshcollider added a commit that referenced this issue Jun 18, 2019
fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes #12989
  * Fixes #15872
  * Fixes #15701
  * Fixes #13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
sidhujag pushed a commit to syscoin/syscoin that referenced this issue Jun 19, 2019
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 10, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 10, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 11, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 11, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 11, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 11, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 13, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 14, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this issue Dec 14, 2021
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
knst pushed a commit to knst/dash that referenced this issue Feb 2, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 2, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 2, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 2, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 2, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 2, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 10, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 10, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
knst pushed a commit to knst/dash that referenced this issue Feb 10, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
UdjinM6 pushed a commit to knst/dash that referenced this issue Feb 10, 2023
…erttopsbt

fa499b5 rpc: bugfix: Properly use iswitness in converttopsbt (MarcoFalke)
fa5c5cd rpc: Switch touched RPCs to IsValidNumArgs (MarcoFalke)

Pull request description:

  When a serialized transaction has inputs, there is no risk in only trying to deserialize it with witness allowed. (This is how all transactions from p2p are deserialized.) In fact, it would avoid a common issue where a transaction with inputs can be deserialized in two ways:
  * Fixes bitcoin#12989
  * Fixes bitcoin#15872
  * Fixes bitcoin#15701
  * Fixes bitcoin#13738
  * ...

  When a serialized transaction has no inputs, there is no risk in only trying to deserialze it with witness disallowed. (A transaction without inputs can't have corresponding witness data)

ACKs for commit fa499b:
  meshcollider:
    utACK bitcoin@fa499b5
  ryanofsky:
    utACK fa499b5. Changes since last review: consolidating commits and making iswitness documentation the same across methods.
  PastaPastaPasta:
    utACK fa499b5

Tree-SHA512: a64423a3131f3f0222a40da557c8b590c9ff01b45bcd40796f77a1a64ae74c6680a6be9d01ece95c492dfbcc7e2810409d2c2b336c2894af00bb213972fc85c6
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants