From 27606f3e0ba1cfae50321e2701716c4fd331cc40 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 09:44:50 -1100 Subject: [PATCH 01/15] Fix typow == 0 --- src/rpc/rawtransaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index e6d356f90..21a6e26cd 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1167,12 +1167,12 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) if ( txConst.IsCoinBase() != 0 ) { if ( (txpow & 2) == 0 ) - txpow == 0; + txpow = 0; } else { if ( (txpow & 1) == 0 ) - txpow == 0; + txpow = 0; } } while ( 1 ) From fcb709c5e80e5e42047894abd7be42e752a7feea Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 09:56:26 -1100 Subject: [PATCH 02/15] +print --- src/wallet/rpcwallet.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 1f4c2c59b..3eeed58a4 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1665,6 +1665,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe BOOST_FOREACH(const COutputEntry& r, listReceived) { string account; + fprintf(stderr,"recv iter %s\n",wtx.GetHash().GetHex()); if (pwalletMain->mapAddressBook.count(r.destination)) account = pwalletMain->mapAddressBook[r.destination].name; if (fAllAccounts || (account == strAccount)) From 80198244d4701a3be42876f8475e7a36a463cd48 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 10:18:42 -1100 Subject: [PATCH 03/15] New prints --- src/wallet/rpcwallet.cpp | 2 +- src/wallet/wallet.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 3eeed58a4..cbda7ea20 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1665,7 +1665,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe BOOST_FOREACH(const COutputEntry& r, listReceived) { string account; - fprintf(stderr,"recv iter %s\n",wtx.GetHash().GetHex()); + //fprintf(stderr,"recv iter %s\n",wtx.GetHash().GetHex()); if (pwalletMain->mapAddressBook.count(r.destination)) account = pwalletMain->mapAddressBook[r.destination].name; if (fAllAccounts || (account == strAccount)) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index be4c8b5a6..d98c0ff78 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1304,6 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, { CWalletTx* wtx = &((*it).second); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); + fprintf(stderr,"ordered iter %s\n",wtx.GetHash().GetHex()); } acentries.clear(); walletdb.ListAccountCreditDebit(strAccount, acentries); From fe0671145e6d6c7925a698ce7fefd40571cfdbdf Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 10:19:12 -1100 Subject: [PATCH 04/15] Fix --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d98c0ff78..ae072d503 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1304,7 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, { CWalletTx* wtx = &((*it).second); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); - fprintf(stderr,"ordered iter %s\n",wtx.GetHash().GetHex()); + fprintf(stderr,"ordered iter %s\n",wtx.GetHash().GetHex().ToString()); } acentries.clear(); walletdb.ListAccountCreditDebit(strAccount, acentries); From 755e64a9af9980caeeeb63238224395577d36a0a Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 10:25:07 -1100 Subject: [PATCH 05/15] -> --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ae072d503..aa0ed6a57 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1304,7 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, { CWalletTx* wtx = &((*it).second); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); - fprintf(stderr,"ordered iter %s\n",wtx.GetHash().GetHex().ToString()); + fprintf(stderr,"ordered iter %s\n",wtx->GetHash().GetHex().ToString()); } acentries.clear(); walletdb.ListAccountCreditDebit(strAccount, acentries); From 7c8828545253368b6cae0dcc0073c902f9e4ba97 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 10:26:19 -1100 Subject: [PATCH 06/15] Fix --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index aa0ed6a57..3b57744af 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1304,7 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, { CWalletTx* wtx = &((*it).second); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); - fprintf(stderr,"ordered iter %s\n",wtx->GetHash().GetHex().ToString()); + fprintf(stderr,"ordered iter %s\n",wtx->GetHash().GetHex().c_str()); } acentries.clear(); walletdb.ListAccountCreditDebit(strAccount, acentries); From 2b66bcf2479b971b5eb907b1a5be6f7ce2663407 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 10:37:13 -1100 Subject: [PATCH 07/15] Move prints --- src/wallet/rpcwallet.cpp | 3 ++- src/wallet/wallet.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index cbda7ea20..335682b60 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1665,7 +1665,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe BOOST_FOREACH(const COutputEntry& r, listReceived) { string account; - //fprintf(stderr,"recv iter %s\n",wtx.GetHash().GetHex()); + fprintf(stderr,"recv iter %s\n",wtx.GetHash().GetHex().c_str()); if (pwalletMain->mapAddressBook.count(r.destination)) account = pwalletMain->mapAddressBook[r.destination].name; if (fAllAccounts || (account == strAccount)) @@ -1817,6 +1817,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp) CWalletTx *const pwtx = (*it).second.first; if (pwtx != 0) ListTransactions(*pwtx, strAccount, 0, true, ret, filter); + else fprintf(stderr,"null pwtx\n"); CAccountingEntry *const pacentry = (*it).second.second; if (pacentry != 0) AcentryToJSON(*pacentry, strAccount, ret); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3b57744af..9097740c9 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1304,7 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, { CWalletTx* wtx = &((*it).second); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); - fprintf(stderr,"ordered iter %s\n",wtx->GetHash().GetHex().c_str()); + //fprintf(stderr,"ordered iter %s\n",wtx->GetHash().GetHex().c_str()); } acentries.clear(); walletdb.ListAccountCreditDebit(strAccount, acentries); From 7883afa7fec29ff964d73d8451fc8723750f4f33 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 10:43:21 -1100 Subject: [PATCH 08/15] Print orderpos --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 9097740c9..82b52b901 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1304,7 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, { CWalletTx* wtx = &((*it).second); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); - //fprintf(stderr,"ordered iter %s\n",wtx->GetHash().GetHex().c_str()); + fprintf(stderr,"ordered iter.%d %s\n",(int32_t)wtx->nOrderPos,wtx->GetHash().GetHex().c_str()); } acentries.clear(); walletdb.ListAccountCreditDebit(strAccount, acentries); From 181d6b33f37ce4453d0f32aa870f705d61632499 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 11:35:11 -1100 Subject: [PATCH 09/15] +prints --- src/wallet/rpcwallet.cpp | 2 +- src/wallet/wallet.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 335682b60..e52a2503b 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1817,7 +1817,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp) CWalletTx *const pwtx = (*it).second.first; if (pwtx != 0) ListTransactions(*pwtx, strAccount, 0, true, ret, filter); - else fprintf(stderr,"null pwtx\n"); + //else fprintf(stderr,"null pwtx\n"); CAccountingEntry *const pacentry = (*it).second.second; if (pacentry != 0) AcentryToJSON(*pacentry, strAccount, ret); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 82b52b901..b5d5b01af 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2533,11 +2533,16 @@ void CWalletTx::GetAmounts(list& listReceived, { // Don't report 'change' txouts if (!(filter & ISMINE_CHANGE) && pwallet->IsChange(txout)) + { + fprintf(stderr,"skip change vout\n"); continue; + } } else if (!(fIsMine & filter)) + { + fprintf(stderr,"skip filtered vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); continue; - + } // In either case, we need to get the destination address CTxDestination address; if (!ExtractDestination(txout.scriptPubKey, address)) @@ -2551,10 +2556,12 @@ void CWalletTx::GetAmounts(list& listReceived, // If we are debited by the transaction, add the output as a "sent" entry if (nDebit > 0) listSent.push_back(output); + else fprintf(stderr,"not sent vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); // If we are receiving the output, add it as a "received" entry if (fIsMine & filter) listReceived.push_back(output); + else fprintf(stderr,"not received vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); } } From 0615c21df0bbcc4f72ac4eff741965001e37287e Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 11:38:07 -1100 Subject: [PATCH 10/15] +print --- src/wallet/rpcwallet.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e52a2503b..f94f07199 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1816,7 +1816,10 @@ UniValue listtransactions(const UniValue& params, bool fHelp) { CWalletTx *const pwtx = (*it).second.first; if (pwtx != 0) + { + fprintf(stderr,"pwtx iter %s\n",pwtx->GetHash().GetHex().c_str()); ListTransactions(*pwtx, strAccount, 0, true, ret, filter); + } //else fprintf(stderr,"null pwtx\n"); CAccountingEntry *const pacentry = (*it).second.second; if (pacentry != 0) From 5f162b1a9de3ada4a000005d04dfc30bd37eefda Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 11:39:51 -1100 Subject: [PATCH 11/15] +print --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index f94f07199..52e92ceb9 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1817,7 +1817,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp) CWalletTx *const pwtx = (*it).second.first; if (pwtx != 0) { - fprintf(stderr,"pwtx iter %s\n",pwtx->GetHash().GetHex().c_str()); + fprintf(stderr,"pwtx iter.%d %s\n",(int32_t)pwtx->nOrderPos,pwtx->GetHash().GetHex().c_str()); ListTransactions(*pwtx, strAccount, 0, true, ret, filter); } //else fprintf(stderr,"null pwtx\n"); From 3b4ee13f944392492c22bc1ebc061224b278a83d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 11:46:51 -1100 Subject: [PATCH 12/15] Allow one change out in list transactions --- src/wallet/wallet.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b5d5b01af..b72ee14f3 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1304,7 +1304,7 @@ CWallet::TxItems CWallet::OrderedTxItems(std::list& acentries, { CWalletTx* wtx = &((*it).second); txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0))); - fprintf(stderr,"ordered iter.%d %s\n",(int32_t)wtx->nOrderPos,wtx->GetHash().GetHex().c_str()); + //fprintf(stderr,"ordered iter.%d %s\n",(int32_t)wtx->nOrderPos,wtx->GetHash().GetHex().c_str()); } acentries.clear(); walletdb.ListAccountCreditDebit(strAccount, acentries); @@ -2522,6 +2522,7 @@ void CWalletTx::GetAmounts(list& listReceived, } // Sent/received. + int32_t oneshot = 0; for (unsigned int i = 0; i < vout.size(); ++i) { const CTxOut& txout = vout[i]; @@ -2534,8 +2535,11 @@ void CWalletTx::GetAmounts(list& listReceived, // Don't report 'change' txouts if (!(filter & ISMINE_CHANGE) && pwallet->IsChange(txout)) { - fprintf(stderr,"skip change vout\n"); - continue; + if ( oneshot++ > 1 ) + { + fprintf(stderr,"skip change vout\n"); + continue; + } } } else if (!(fIsMine & filter)) From 80be59463871910ff88c1449855a254196a56244 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 11:47:18 -1100 Subject: [PATCH 13/15] -print --- src/wallet/wallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b72ee14f3..b8587a943 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2560,12 +2560,12 @@ void CWalletTx::GetAmounts(list& listReceived, // If we are debited by the transaction, add the output as a "sent" entry if (nDebit > 0) listSent.push_back(output); - else fprintf(stderr,"not sent vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); + //else fprintf(stderr,"not sent vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); // If we are receiving the output, add it as a "received" entry if (fIsMine & filter) listReceived.push_back(output); - else fprintf(stderr,"not received vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); + //else fprintf(stderr,"not received vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); } } From 9742bb74db0fb99de068fe1f99f5ab4ad0deba7f Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 11:48:48 -1100 Subject: [PATCH 14/15] -prints --- src/wallet/rpcwallet.cpp | 4 ++-- src/wallet/wallet.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 52e92ceb9..fc8269008 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1665,7 +1665,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe BOOST_FOREACH(const COutputEntry& r, listReceived) { string account; - fprintf(stderr,"recv iter %s\n",wtx.GetHash().GetHex().c_str()); + //fprintf(stderr,"recv iter %s\n",wtx.GetHash().GetHex().c_str()); if (pwalletMain->mapAddressBook.count(r.destination)) account = pwalletMain->mapAddressBook[r.destination].name; if (fAllAccounts || (account == strAccount)) @@ -1817,7 +1817,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp) CWalletTx *const pwtx = (*it).second.first; if (pwtx != 0) { - fprintf(stderr,"pwtx iter.%d %s\n",(int32_t)pwtx->nOrderPos,pwtx->GetHash().GetHex().c_str()); + //fprintf(stderr,"pwtx iter.%d %s\n",(int32_t)pwtx->nOrderPos,pwtx->GetHash().GetHex().c_str()); ListTransactions(*pwtx, strAccount, 0, true, ret, filter); } //else fprintf(stderr,"null pwtx\n"); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b8587a943..3857f7090 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2537,14 +2537,14 @@ void CWalletTx::GetAmounts(list& listReceived, { if ( oneshot++ > 1 ) { - fprintf(stderr,"skip change vout\n"); + //fprintf(stderr,"skip change vout\n"); continue; } } } else if (!(fIsMine & filter)) { - fprintf(stderr,"skip filtered vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); + //fprintf(stderr,"skip filtered vout %d %d\n",(int32_t)fIsMine,(int32_t)filter); continue; } // In either case, we need to get the destination address From 3958b39ead8f32d58534494b3290b759f503c371 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 10 Dec 2018 11:53:34 -1100 Subject: [PATCH 15/15] Fix rewards claim txid not appearing in list transactions --- src/wallet/rpcwallet.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index fc8269008..c34466a39 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1819,8 +1819,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp) { //fprintf(stderr,"pwtx iter.%d %s\n",(int32_t)pwtx->nOrderPos,pwtx->GetHash().GetHex().c_str()); ListTransactions(*pwtx, strAccount, 0, true, ret, filter); - } - //else fprintf(stderr,"null pwtx\n"); + } //else fprintf(stderr,"null pwtx\n"); CAccountingEntry *const pacentry = (*it).second.second; if (pacentry != 0) AcentryToJSON(*pacentry, strAccount, ret);