]> Git Repo - VerusCoin.git/commitdiff
Cross notarization fix
authorMichael Toutonghi <[email protected]>
Wed, 15 May 2019 21:01:37 +0000 (14:01 -0700)
committerMichael Toutonghi <[email protected]>
Wed, 15 May 2019 21:01:37 +0000 (14:01 -0700)
src/pbaas/notarization.cpp
src/rpc/pbaasrpc.cpp

index 36794e19826a2cfc8a6e383b9bb6d851f96f6b87..48ad237e3434ea8bfdb838f1ffd99ddbc9adc8f1 100644 (file)
@@ -310,8 +310,9 @@ vector<CInputDescriptor> AddSpendsAndFinalizations(const CChainNotarizationData
     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);
 
index 3096dc7e09f736fd6d9368d86f55021c1be98c0e..a06b067b2f52e2c977778edb5e864928db2a2f24 100644 (file)
@@ -774,7 +774,7 @@ UniValue submitacceptednotarization(const UniValue& params, bool fHelp)
         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");
             }
@@ -843,7 +843,7 @@ UniValue submitacceptednotarization(const UniValue& params, bool fHelp)
                     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
This page took 0.040143 seconds and 4 git commands to generate.