File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ bool GetKeyIDFromUTXO(const CTxOut& txout, CKeyID& keyID)
2222 return false ;
2323 if (whichType == TX_PUBKEY) {
2424 keyID = CPubKey (vSolutions[0 ]).GetID ();
25- } else if (whichType == TX_PUBKEYHASH) {
25+ } else if (whichType == TX_PUBKEYHASH || whichType == TX_COLDSTAKE ) {
2626 keyID = CKeyID (uint160 (vSolutions[0 ]));
27+ } else {
28+ return false ;
2729 }
2830
2931 return true ;
@@ -80,6 +82,12 @@ bool CheckBlockSignature(const CBlock& block)
8082 if (whichType == TX_PUBKEY || whichType == TX_PUBKEYHASH) {
8183 valtype& vchPubKey = vSolutions[0 ];
8284 pubkey = CPubKey (vchPubKey);
85+ } else if (whichType == TX_COLDSTAKE) {
86+ // pick the public key from the P2CS input
87+ const CTxIn& txin = block.vtx [1 ].vin [0 ];
88+ int start = 1 + (int ) *txin.scriptSig .begin (); // skip sig
89+ start += 1 + (int ) *(txin.scriptSig .begin ()+start); // skip flag
90+ pubkey = CPubKey (txin.scriptSig .begin ()+start+1 , txin.scriptSig .end ());
8391 }
8492 }
8593
You can’t perform that action at this time.
0 commit comments