aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-04-25 19:30:28 +0200
committerPieter Wuille <pieterw@google.com>2013-04-25 19:36:10 +0200
commit360cfe142c552ac5c4d904a1e970390188151ca8 (patch)
tree4e8232b61d597b9720cbb98a54d07690324b6c3b /src/main.cpp
parent77a1e12eed5fc66dce16584696f54988a8c2bf4e (diff)
downloadbitcoin-360cfe142c552ac5c4d904a1e970390188151ca8.tar.xz
Allow the default key to be unavailable
This solves the issue where no default key can be added after -salvagewallet.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index aace382d8b..45fb7af005 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4158,7 +4158,10 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey)
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
- txNew.vout[0].scriptPubKey << reservekey.GetReservedKey() << OP_CHECKSIG;
+ CPubKey pubkey;
+ if (!reservekey.GetReservedKey(pubkey))
+ return NULL;
+ txNew.vout[0].scriptPubKey << pubkey << OP_CHECKSIG;
// Add our coinbase tx as first transaction
pblock->vtx.push_back(txNew);