Skip to content

Commit a9c0331

Browse files
committed
Remove duplicate pegin test
v0,14 doesn't have the CheckTxInputs check later in this method. Since the pegins are checked in that method, this check seemed redundant.
1 parent 60c7fea commit a9c0331

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

src/validation.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -722,23 +722,6 @@ static bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool
722722
}
723723
}
724724

725-
// ELEMENTS:
726-
// Extract peg-in inputs, pass set to mempool entry. Validity of pegins checked in CheckInputs
727-
for (unsigned int i = 0; i < tx.vin.size(); i++) {
728-
if (tx.vin[i].m_is_pegin) {
729-
// Quick check of pegin witness and prevout to extract db entry
730-
if (tx.vin[i].m_pegin_witness.stack.size() < 6 || uint256(tx.vin[i].m_pegin_witness.stack[2]).IsNull() || tx.vin[i].prevout.hash.IsNull()) {
731-
return state.Invalid(false, REJECT_INVALID, "pegin-no-witness");
732-
}
733-
std::pair<uint256, COutPoint> pegin = std::make_pair(uint256(tx.vin[i].m_pegin_witness.stack[2]), tx.vin[i].prevout);
734-
// This assumes non-null prevout and genesis block hash
735-
if (view.IsWithdrawSpent(pegin)) {
736-
return state.Invalid(false, REJECT_DUPLICATE, "pegin-already-claimed");
737-
}
738-
setPeginsSpent.insert(pegin);
739-
}
740-
}
741-
742725
// Bring the best block into scope
743726
view.GetBestBlock();
744727

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5184,7 +5184,7 @@ UniValue claimpegin(const JSONRPCRequest& request)
51845184
UniValue varr(UniValue::VARR);
51855185
varr.push_back(ret["hex"]);
51865186
request2.params = varr;
5187-
UniValue result = signrawtransaction(request2);
5187+
UniValue result = signrawtransactionwithwallet(request2);
51885188

51895189
// Send it
51905190
JSONRPCRequest request3;

test/functional/feature_fedpeg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def run_test(self):
273273
# since this wallet originated the claim_script itself
274274
sidechain.createrawpegin(raw, proof, addrs["claim_script"])
275275
sidechain.createrawpegin(raw, proof)
276-
signed_pegin = sidechain.signrawtransaction(raw_pegin)
276+
signed_pegin = sidechain.signrawtransactionwithwallet(raw_pegin)
277277
assert(signed_pegin["complete"])
278278
assert("warning" in signed_pegin) # warning for immature peg-in
279279
# fully mature them now

0 commit comments

Comments
 (0)