fundrawtransaction #6088

pull TheBlueMatt wants to merge 5 commits into bitcoin:master from TheBlueMatt:frt2 changing 12 files +787 −14
  1. TheBlueMatt commented at 8:54 pm on April 30, 2015: member
    This superceedes #5503 and #5524. I rewrote chunks of the first and largely rewrote the second, stealing test cases almost verbatim from both.
  2. laanwj added the label Wallet on May 1, 2015
  3. laanwj added the label RPC on May 1, 2015
  4. laanwj added this to the milestone 0.11.0 on May 1, 2015
  5. sipa commented at 12:45 pm on May 1, 2015: member
    Could we have a DummySignatureCreator, instead of passing a dummy boolean to TransactionSignatureCreator?
  6. sipa commented at 12:50 pm on May 1, 2015: member
    I had to read the source code to guess what ‘fAllowOtherInputs’ means. Can you add a comment?
  7. jonasschnelli commented at 12:52 pm on May 1, 2015: contributor
    @sipa: I tried this (“DummySignatorCreator”). But somehow i stopped it because it was getting a inheritance mess. I can’t actually remember why exactly.
  8. sipa commented at 12:55 pm on May 1, 2015: member
    @jonasschnelli Let me hack something up.
  9. sipa commented at 1:24 pm on May 1, 2015: member
  10. jonasschnelli commented at 2:11 pm on May 1, 2015: contributor
    @sipa: are you sure this would work also for P2SH Multisig inputs?
  11. sipa commented at 2:19 pm on May 1, 2015: member

    @jonasschnelli pretty sure, it should.

    BaseSignatureCreator is about creating individual (DER+nHashType) signatures, and is called by ProduceSignature wherever necessary. For multisig/P2SH, it will be called multiple times as necessary.

  12. jonasschnelli commented at 5:05 pm on May 1, 2015: contributor

    @sipa: Right. I would do so. To make use of https://github.com/sipa/bitcoin/commit/134090be5a0aaad27981ed4d4fe52a843fce337b it would need some adaptation and some changes within SignSignature(). I just tried but had some compiling/casting issues with the DummySignatureChecker class.

    But the current solution (as it is in this PR) without a DummySignatorCreator class works well and basically adds only 8 lines of code. But indeed its not that elegant as sipas proposal.

  13. sipa commented at 5:18 pm on May 1, 2015: member
    I’m fine with fixing it up afterwards.
  14. jgarzik commented at 4:02 pm on May 2, 2015: contributor
    Concept ACK - the dummy sig stuff is ugly and poops all over several function/method sigs
  15. laanwj commented at 8:07 am on May 6, 2015: member
    The dummy sig business may be ugly, but it was introduced to avoid even uglier solutions to compute signature sizes: either having parallel byte accounting functioning (lots of duplicate hard-to-crosscheck code), or doing real signing then throwing away the result (requires wallet to be unlocked and is just wrong).
  16. laanwj removed this from the milestone 0.11.0 on May 18, 2015
  17. jonasschnelli commented at 1:45 pm on May 18, 2015: contributor
    Needs rebase.
  18. luke-jr commented at 3:15 am on June 2, 2015: member
    Dummy sign may be ugly, but it also would enable prompting the user with fee etc prior to passphrase being entered…
  19. in src/wallet/rpcdump.cpp: in 0b05c94ff6 outdated
    157             "\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.\n"
    158             "\nArguments:\n"
    159             "1. \"address\"          (string, required) The address\n"
    160             "2. \"label\"            (string, optional, default=\"\") An optional label\n"
    161             "3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions\n"
    162+            "4. p2sh                 (boolean, optional, default=false) Add the P2SH version of the script as well\n"
    


    luke-jr commented at 3:16 am on June 2, 2015:
    This seems nonsensical. What is the use case?
  20. TheBlueMatt commented at 6:58 am on June 11, 2015: member
    So it turns out the watch-only signing never worked anyway (it used the constant “0” for the public key when calculating size of pay-to-pubkey-hash txn), so I walked that back and watchonly-supporting fundrawtransaction will be a separate pull.
  21. TheBlueMatt force-pushed on Jun 11, 2015
  22. TheBlueMatt force-pushed on Jun 11, 2015
  23. TheBlueMatt force-pushed on Jun 11, 2015
  24. Add DummySignatureCreator which just creates zeroed sigs 9b4e7d9a5e
  25. Small tweaks to CCoinControl for fundrawtransaction 2d84e22703
  26. Add FundTransaction method to wallet
    Some code stolen from Jonas Schnelli <jonas.schnelli@include7.ch>
    1e0d1a2ff0
  27. Add fundrawtransaction RPC method 21bbd920e5
  28. fundrawtransaction tests 208589514c
  29. TheBlueMatt force-pushed on Jun 11, 2015
  30. laanwj merged this on Jun 23, 2015
  31. laanwj closed this on Jun 23, 2015

  32. laanwj referenced this in commit 91389e51c7 on Jun 23, 2015
  33. btcdrak commented at 10:57 pm on June 23, 2015: contributor
    ACK
  34. laanwj commented at 5:14 am on June 24, 2015: member
    Tested ACK (which I forgot to post)
  35. jonasschnelli commented at 6:39 am on June 24, 2015: contributor
    Post merge ACK
  36. in src/wallet/wallet.cpp: in 208589514c
    1753+    CReserveKey reservekey(this);
    1754+    CWalletTx wtx;
    1755+    if (!CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosRet, strFailReason, &coinControl, false))
    1756+        return false;
    1757+
    1758+    if (nChangePosRet != -1)
    


    sipa commented at 8:34 pm on June 24, 2015:
    Any reason for trying to guess the changes made by CreateTransaction, and applying those on the original, rather than just using the constructed result?
  37. sipa commented at 9:03 pm on June 24, 2015: member
    Posthumous untested ACK.
  38. zkbot referenced this in commit 9af55822fb on Feb 15, 2017
  39. zkbot referenced this in commit a7cf698873 on Mar 4, 2017
  40. furszy referenced this in commit 0724bbbad2 on Jun 28, 2020
  41. random-zebra referenced this in commit 5a092159f6 on Aug 5, 2020
  42. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me