From 36cace876359f942063bd611f375602a9ed96266 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Tue, 8 Jan 2013 20:06:59 +0100 Subject: [PATCH] message: storing dirty privkey --- src/message.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/message.cpp b/src/message.cpp index 4ba7ef9..5aedfac 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -86,8 +86,13 @@ int signed_msg::sign (const bvector&msg, if (r) return r; - //make sure the modified privkey gets stored correctly - //TODO + if (privkey_dirty) { + kr.remove_privkey (key_id); + //this actually shouldn't fail, key_id is not present + kr.store_privkey (key_id, privkey); + //we can't output a signature without storing privkey changes + if (!kr.disk_sync() ) return 3; + } return 0; }