if (!lastNotarizationID.IsNull())
{
// spend notarization output of the last notarization
- txInputs.push_back(CInputDescriptor(lastTx.vout[j].scriptPubKey, lastTx.vout[j].nValue, CTxIn(lastNotarizationID, j, CScript())));
- mnewTx.vin.push_back(CTxIn(lastNotarizationID, j, CScript()));
+ uint256 lastTxHash = lastTx.GetHash();
+ txInputs.push_back(CInputDescriptor(lastTx.vout[j].scriptPubKey, lastTx.vout[j].nValue, CTxIn(lastTxHash, j, CScript())));
+ mnewTx.vin.push_back(CTxIn(lastTxHash, j, CScript()));
LOCK(cs_main);
uint256 blkHash;
{
LOCK(cs_main);
- if (!myGetTransaction(pbn.prevNotarization, lastTx, blkHash))
+ if (!myGetTransaction(nData.vtx.back().first, lastTx, blkHash))
{
throw JSONRPCError(RPC_TRANSACTION_ERROR, "Cannot access prior notarization");
}
if (myGetTransaction(mnewTx.vin[confirmedInput].prevout.hash, confirmedTx, hashBlock) &&
(it = mapBlockIndex.find(hashBlock)) != mapBlockIndex.end())
{
- pindex = mapBlockIndex.find(blkHash)->second;
+ pindex = mapBlockIndex.find(hashBlock)->second;
}
// add all inputs that might provide notary reward and calculate notary reward based on that plus current