MCPcopy Create free account
hub / github.com/ElementsProject/elements / DummySignInput

Function DummySignInput

src/wallet/spend.cpp:42–53  ·  view source on GitHub ↗

Helper for producing a max-sized low-S low-R signature (eg 71 bytes) or a max-sized low-S signature (e.g. 72 bytes) if use_max_sig is true

Source from the content-addressed store, hash-verified

40// Helper for producing a max-sized low-S low-R signature (eg 71 bytes)
41// or a max-sized low-S signature (e.g. 72 bytes) if use_max_sig is true
42bool DummySignInput(const SigningProvider& provider, CMutableTransaction& tx, const size_t nIn, const CTxOut& txout, bool use_max_sig)
43{
44 // Fill in dummy signatures for fee calculation.
45 const CScript& scriptPubKey = txout.scriptPubKey;
46 SignatureData sigdata;
47
48 if (!ProduceSignature(provider, use_max_sig ? DUMMY_MAXIMUM_SIGNATURE_CREATOR : DUMMY_SIGNATURE_CREATOR, scriptPubKey, sigdata)) {
49 return false;
50 }
51 UpdateTransaction(tx, nIn, sigdata);
52 return true;
53}
54
55// Helper for producing a bunch of max-sized low-S low-R signatures (eg 71 bytes)
56bool CWallet::DummySignTx(CMutableTransaction &txNew, const std::vector<CTxOut> &txouts, const CCoinControl* coin_control) const

Callers 2

DummySignTxMethod · 0.85

Calls 2

ProduceSignatureFunction · 0.85
UpdateTransactionFunction · 0.85

Tested by

no test coverage detected