aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2013-04-25 19:30:28 +0200
committerPieter Wuille <[email protected]>2013-04-25 19:36:10 +0200
commit360cfe142c552ac5c4d904a1e970390188151ca8 (patch)
tree4e8232b61d597b9720cbb98a54d07690324b6c3b /src/main.cpp
parentMerge pull request #2554 from fanquake/qt-pro-brew-patch (diff)
downloaddiscoin-360cfe142c552ac5c4d904a1e970390188151ca8.tar.xz
discoin-360cfe142c552ac5c4d904a1e970390188151ca8.zip
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 aace382d8..45fb7af00 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);