aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2013-05-03 14:33:02 -0700
committerGavin Andresen <[email protected]>2013-05-03 14:33:02 -0700
commit61a845dcb6528bc9b04272f73d4d5681be858a6f (patch)
tree48cd87c19d675e00bd328d682f033acff54e57ae /src/main.cpp
parentMerge pull request #2607 from gavinandresen/loadwalletfix (diff)
parentAllow the default key to be unavailable (diff)
downloaddiscoin-61a845dcb6528bc9b04272f73d4d5681be858a6f.tar.xz
discoin-61a845dcb6528bc9b04272f73d4d5681be858a6f.zip
Merge pull request #2566 from sipa/nodef
Allow the default key to be unavailable
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);