From f4dfe2744283b5a393e722c8c52922259f08342c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 8 May 2018 22:44:52 +0300 Subject: [PATCH 1/6] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8daa0d32a..8b310c56d 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -668,7 +668,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block,uint32_t prevtim { for (i=0; i 1 ) { if ( block.vtx[txn_count-1].vin.size() == 1 && GetTransaction(block.vtx[txn_count-1].vin[0].prevout.hash,tx,hash,false) && block.vtx[0].vout[0].scriptPubKey == tx.vout[block.vtx[txn_count-1].vin[0].prevout.n].scriptPubKey ) notmatched = 1; From 751df7814f0813e43249366286e09d61d9a9dacd Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 8 May 2018 22:51:57 +0300 Subject: [PATCH 2/6] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 8b310c56d..b0ebac4c4 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -668,7 +668,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block,uint32_t prevtim { for (i=0; i 1 ) + if ( i == 0 && txn_count > 1 && block.vtx[txn_count-1].vout[0].nValue == 5000 ) { if ( block.vtx[txn_count-1].vin.size() == 1 && GetTransaction(block.vtx[txn_count-1].vin[0].prevout.hash,tx,hash,false) && block.vtx[0].vout[0].scriptPubKey == tx.vout[block.vtx[txn_count-1].vin[0].prevout.n].scriptPubKey ) notmatched = 1; From 2e12bbce39dc92c519f5e363d7526d87b1234ce7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 8 May 2018 23:08:00 +0300 Subject: [PATCH 3/6] Test --- src/komodo_gateway.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index b0ebac4c4..018baa675 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -668,7 +668,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block,uint32_t prevtim { for (i=0; i 1 && block.vtx[txn_count-1].vout[0].nValue == 5000 ) + if ( i == 0 && txn_count > 1 && block.vtx[txn_count-1].vout.size() > 0 && block.vtx[txn_count-1].vout[0].nValue == 5000 ) { if ( block.vtx[txn_count-1].vin.size() == 1 && GetTransaction(block.vtx[txn_count-1].vin[0].prevout.hash,tx,hash,false) && block.vtx[0].vout[0].scriptPubKey == tx.vout[block.vtx[txn_count-1].vin[0].prevout.n].scriptPubKey ) notmatched = 1; From b9b415654fd706e3a31d820db4f80c985bd33e3a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 May 2018 09:36:27 +0300 Subject: [PATCH 4/6] Restore possibility of negative timestamps for PoS --- src/main.cpp | 5 ----- src/rpcrawtransaction.cpp | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index cdb0b3f3e..31528442f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3783,11 +3783,6 @@ bool CheckBlockHeader(int32_t *futureblockp,int32_t height,CBlockIndex *pindex, return false; //state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),REJECT_INVALID, "time-too-new"); } } - if ( ASSETCHAINS_STAKED != 0 && pindex != 0 && pindex->pprev != 0 && pindex->nTime <= pindex->pprev->nTime ) - { - fprintf(stderr,"ht.%d %u vs ht.%d %u, is not monotonic\n",pindex->nHeight,pindex->nTime,pindex->pprev->nHeight,pindex->pprev->nTime); - return state.Invalid(error("CheckBlockHeader(): block timestamp needs to always increase"),REJECT_INVALID, "time-too-new"); - } // Check block version if (height > 0 && blockhdr.nVersion < MIN_BLOCK_VERSION) return state.DoS(100, error("CheckBlockHeader(): block version too low"),REJECT_INVALID, "version-too-low"); diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 8c88abe43..8130ba0a5 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -138,6 +138,8 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue& else { in.push_back(Pair("txid", txin.prevout.hash.GetHex())); in.push_back(Pair("vout", (int64_t)txin.prevout.n)); + + UniValue o(UniValue::VOBJ); o.push_back(Pair("asm", txin.scriptSig.ToString())); o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); From 1d03bae255c2fa185289a089d162126ff2e937e6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 May 2018 09:55:43 +0300 Subject: [PATCH 5/6] Display vin address in tx son --- src/rpcrawtransaction.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 8130ba0a5..db830b388 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -138,8 +138,14 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue& else { in.push_back(Pair("txid", txin.prevout.hash.GetHex())); in.push_back(Pair("vout", (int64_t)txin.prevout.n)); - - + { + uint256 hash; CTransaction tx; CTxDestination address; + if (GetTransaction(txin.prevout.hash,tx,hash,false)) + { + if (ExtractDestination(tx.scriptPubKey, address)) + in.push_back(Pair("address", address.ToString())); + } + } UniValue o(UniValue::VOBJ); o.push_back(Pair("asm", txin.scriptSig.ToString())); o.push_back(Pair("hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); From c1ec8014fab2f915c0333a6b9fc7e45877bc5abe Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 9 May 2018 09:58:52 +0300 Subject: [PATCH 6/6] Test --- src/rpcrawtransaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index db830b388..8b722e931 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -142,8 +142,8 @@ void TxToJSONExpanded(const CTransaction& tx, const uint256 hashBlock, UniValue& uint256 hash; CTransaction tx; CTxDestination address; if (GetTransaction(txin.prevout.hash,tx,hash,false)) { - if (ExtractDestination(tx.scriptPubKey, address)) - in.push_back(Pair("address", address.ToString())); + if (ExtractDestination(tx.vout[txin.prevout.n].scriptPubKey, address)) + in.push_back(Pair("address", CBitcoinAddress(address).ToString())); } } UniValue o(UniValue::VOBJ);