diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-07-31 17:24:44 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-12-10 08:29:47 -0500 |
commit | 81521173ba830ca1dea204e83897482f8970e519 (patch) | |
tree | 56fb16333bc7317b4cc47be34fc29fe4a96028e7 /src/psbt.cpp | |
parent | d8043ddf640b1bb7a536834618c468334e3eb15f (diff) |
Merge global xpubs in joinpsbts and combinepsbts
Diffstat (limited to 'src/psbt.cpp')
-rw-r--r-- | src/psbt.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp index f3ecbd63d2..4c9b439815 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -32,6 +32,13 @@ bool PartiallySignedTransaction::Merge(const PartiallySignedTransaction& psbt) for (unsigned int i = 0; i < outputs.size(); ++i) { outputs[i].Merge(psbt.outputs[i]); } + for (auto& xpub_pair : psbt.m_xpubs) { + if (m_xpubs.count(xpub_pair.first) == 0) { + m_xpubs[xpub_pair.first] = xpub_pair.second; + } else { + m_xpubs[xpub_pair.first].insert(xpub_pair.second.begin(), xpub_pair.second.end()); + } + } unknown.insert(psbt.unknown.begin(), psbt.unknown.end()); return true; |