aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp7
-rw-r--r--src/rpcrawtransaction.cpp16
2 files changed, 16 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1e40db8f75..8c115c26f9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3812,7 +3812,12 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
}
// Resend wallet transactions that haven't gotten in a block yet
- ResendWalletTransactions();
+ // Except during reindex, importing and IBD, when old wallet
+ // transactions become unconfirmed and spams other nodes.
+ if (!fReindex && !fImporting && !IsInitialBlockDownload())
+ {
+ ResendWalletTransactions();
+ }
// Address refresh broadcast
static int64 nLastRebroadcast;
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp
index 5224051ace..bbaf40c735 100644
--- a/src/rpcrawtransaction.cpp
+++ b/src/rpcrawtransaction.cpp
@@ -421,7 +421,7 @@ Value signrawtransaction(const Array& params, bool fHelp)
Object prevOut = p.get_obj();
- RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
+ RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type));
uint256 txid = ParseHashO(prevOut, "txid");
@@ -450,12 +450,16 @@ Value signrawtransaction(const Array& params, bool fHelp)
// if redeemScript given and not using the local wallet (private keys
// given), add redeemScript to the tempKeystore so it can be signed:
- Value v = find_value(prevOut, "redeemScript");
- if (fGivenKeys && scriptPubKey.IsPayToScriptHash() && !(v == Value::null))
+ if (fGivenKeys && scriptPubKey.IsPayToScriptHash())
{
- vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
- CScript redeemScript(rsData.begin(), rsData.end());
- tempKeystore.AddCScript(redeemScript);
+ RPCTypeCheck(prevOut, map_list_of("txid", str_type)("vout", int_type)("scriptPubKey", str_type)("redeemScript",str_type));
+ Value v = find_value(prevOut, "redeemScript");
+ if (!(v == Value::null))
+ {
+ vector<unsigned char> rsData(ParseHexV(v, "redeemScript"));
+ CScript redeemScript(rsData.begin(), rsData.end());
+ tempKeystore.AddCScript(redeemScript);
+ }
}
}
}