Skip to content

Commit 8a216cc

Browse files
UdjinM6PastaPastaPasta
authored andcommitted
fix
1 parent 6478562 commit 8a216cc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ UniValue combinerawtransaction(const JSONRPCRequest& request)
614614
std::vector<CMutableTransaction> txVariants(txs.size());
615615

616616
for (unsigned int idx = 0; idx < txs.size(); idx++) {
617-
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) {
617+
if (!DecodeHexTx(txVariants[idx], txs[idx].get_str())) {
618618
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed for tx %d", idx));
619619
}
620620
}
@@ -655,18 +655,13 @@ UniValue combinerawtransaction(const JSONRPCRequest& request)
655655
throw JSONRPCError(RPC_VERIFY_ERROR, "Input not found or already spent");
656656
}
657657
const CScript& prevPubKey = coin.out.scriptPubKey;
658-
const CAmount& amount = coin.out.nValue;
659-
660-
SignatureData sigdata;
661658

662659
// ... and merge in other signatures:
663660
for (const CMutableTransaction& txv : txVariants) {
664661
if (txv.vin.size() > i) {
665-
sigdata = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i, amount), sigdata, DataFromTransaction(txv, i));
662+
txin.scriptSig = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i), txin.scriptSig, txv.vin[i].scriptSig);
666663
}
667664
}
668-
669-
UpdateTransaction(mergedTx, i, sigdata);
670665
}
671666

672667
return EncodeHexTx(mergedTx);
@@ -744,7 +739,7 @@ UniValue signrawtransaction(const JSONRPCRequest& request)
744739
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true);
745740

746741
CMutableTransaction mtx;
747-
if (!DecodeHexTx(mtx, request.params[0].get_str(), true))
742+
if (!DecodeHexTx(mtx, request.params[0].get_str()))
748743
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
749744

750745
// Fetch previous transactions (inputs):

test/functional/rawtransactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def run_test(self):
171171
self.sync_all()
172172
self.nodes[0].generate(1)
173173
self.sync_all()
174-
assert_equal(self.nodes[0].getbalance(), bal+Decimal('50.00000000')+Decimal('2.19000000')) #block reward + tx
174+
assert_equal(self.nodes[0].getbalance(), bal+Decimal('500.00000000')+Decimal('2.19000000')) #block reward + tx
175175

176176
# getrawtransaction tests
177177
# 1. valid parameters - only supply txid

0 commit comments

Comments
 (0)