Changeset View
Changeset View
Standalone View
Standalone View
src/script/sign.cpp
Show First 20 Lines • Show All 409 Lines • ▼ Show 20 Lines | public: | ||||
DummySignatureCreator() {} | DummySignatureCreator() {} | ||||
const BaseSignatureChecker &Checker() const override { | const BaseSignatureChecker &Checker() const override { | ||||
return DUMMY_CHECKER; | return DUMMY_CHECKER; | ||||
} | } | ||||
bool CreateSig(const SigningProvider &provider, | bool CreateSig(const SigningProvider &provider, | ||||
std::vector<uint8_t> &vchSig, const CKeyID &keyid, | std::vector<uint8_t> &vchSig, const CKeyID &keyid, | ||||
const CScript &scriptCode) const override { | const CScript &scriptCode) const override { | ||||
// Create a dummy signature that is a valid DER-encoding | // Create a dummy signature that is a valid DER-encoding | ||||
vchSig.assign(72, '\000'); | vchSig.assign(71, '\000'); | ||||
vchSig[0] = 0x30; | vchSig[0] = 0x30; | ||||
vchSig[1] = 69; | vchSig[1] = 68; | ||||
vchSig[2] = 0x02; | vchSig[2] = 0x02; | ||||
vchSig[3] = 33; | vchSig[3] = 32; | ||||
vchSig[4] = 0x01; | vchSig[4] = 0x01; | ||||
vchSig[4 + 33] = 0x02; | vchSig[4 + 32] = 0x02; | ||||
vchSig[5 + 33] = 32; | vchSig[5 + 32] = 32; | ||||
vchSig[6 + 33] = 0x01; | vchSig[6 + 32] = 0x01; | ||||
vchSig[6 + 33 + 32] = SIGHASH_ALL | SIGHASH_FORKID; | vchSig[6 + 32 + 32] = SIGHASH_ALL | SIGHASH_FORKID; | ||||
return true; | return true; | ||||
} | } | ||||
}; | }; | ||||
template <typename M, typename K, typename V> | template <typename M, typename K, typename V> | ||||
bool LookupHelper(const M &map, const K &key, V &value) { | bool LookupHelper(const M &map, const K &key, V &value) { | ||||
auto it = map.find(key); | auto it = map.find(key); | ||||
if (it != map.end()) { | if (it != map.end()) { | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |