Skip to content

Commit

Permalink
Merge pull request #53 from BlockMechanic/segwit
Browse files Browse the repository at this point in the history
Update nodewallet.cpp
  • Loading branch information
BlockMechanic authored Apr 9, 2022
2 parents ffe65db + 364698a commit b417bcd
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/crown/nodewallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool NodeWallet::GetVinAndKeysFromOutput(COutput out, CTxIn& txinRet, CPubKey& p
pubScript = out.tx->tx->vpout[out.i].scriptPubKey;
else
pubScript = out.tx->tx->vout[out.i].scriptPubKey;


CTxDestination address;
ExtractDestination(pubScript, address);
Expand Down Expand Up @@ -271,20 +271,21 @@ bool GetPointers(stakingnode* pstaker, std::vector<StakePointer>& vStakePointers
uint256 hashPointer = stakeSource.GetHash();
if (mapUsedStakePointers.count(hashPointer))
continue;
LogPrintf("%s: %s\n", __func__, tx->ToString());

CTxOutAsset mout = (tx->nVersion >= TX_ELE_VERSION ? tx->vpout[nPaymentSlot] : tx->vout[nPaymentSlot]);

LogPrintf("%s: 2.4.1\n", __func__);

if (tx->IsCoinBase() && mout.scriptPubKey == scriptMNPubKey) {
StakePointer stakePointer;
stakePointer.hashBlock = pindex->GetBlockHash();
stakePointer.txid = tx->GetHash();
stakePointer.nPos = nPaymentSlot;
stakePointer.pubKeyProofOfStake = pstaker->pubkey;
vStakePointers.emplace_back(stakePointer);
found = true;
continue;

if (tx->IsCoinBase()) {
CTxOutAsset mout = (tx->nVersion >= TX_ELE_VERSION ? tx->vpout[nPaymentSlot] : tx->vout[nPaymentSlot]);
if(mout.scriptPubKey == scriptMNPubKey){
StakePointer stakePointer;
stakePointer.hashBlock = pindex->GetBlockHash();
stakePointer.txid = tx->GetHash();
stakePointer.nPos = nPaymentSlot;
stakePointer.pubKeyProofOfStake = pstaker->pubkey;
vStakePointers.emplace_back(stakePointer);
found = true;
continue;
}
}
LogPrintf("%s: 2.4.2\n", __func__);

Expand Down

0 comments on commit b417bcd

Please sign in to comment.